using Lucene.Net;
using Lucene.Net.Util;
using Lucene.Net.Store;
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Standard;

namespace ODSearchEngine.Lucene
{
	
	internal class MyAnalyzer : StandardAnalyzer
	{
		public MyAnalyzer(Version version) : base(version) { }
		public override TokenStream TokenStream (string fieldName, System.IO.TextReader reader)
		{
			TokenStream result = base.TokenStream(fieldName, reader);
			result = new LowerCaseFilter(result);
			return result;
		}
	}
	internal static class Constants
	{
		public static readonly Version version = Version.LUCENE_29;
		public static readonly string indexFolderPath = "./index";
		public static readonly Directory indexDirectory = FSDirectory.Open(new System.IO.DirectoryInfo(Constants.indexFolderPath));
		public static readonly Analyzer defaultAnalyzer = new MyAnalyzer(Constants.version);
		
		public static readonly string fieldParameterValue = "pValue";
		public static readonly string fieldParameterName = "pName";
		public static readonly string fieldID = "ID";
		public static readonly string defaultFieldName = Constants.fieldParameterValue;
		
	}
}

